package com.controller.owner;

import com.alibaba.fastjson.JSONObject;
import com.service.OwnerService;
import com.utils.BaseController;
import com.utils.DataTables;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 *  业主管理 Controller
 */
@Controller
@RequestMapping("/owner")
public class OwnerController extends BaseController{

    @Autowired
    private HttpServletRequest request;

    @Autowired
    private OwnerService ownerService;

    /**
     * 显示所有分页数据
     *
     * @return
     */
    @RequestMapping(value = "/getPageList.do",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    @ResponseBody
    public String getPageList(){
        return JSONObject.toJSONString(ownerService.getPageList(DataTables.getInstance(request,null)));
    }

}
